package com.rogue.blog.model.dto.article;

import com.rogue.blog.model.po.article.ArticleCategoryPO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;

/**
 * Created by 86101 on 2018-10-09.
 */
@ApiModel(description = "文章分类数据传输对象")
@Getter
@Setter
public class ArticleCategoryDTO {
    @ApiModelProperty(value = "分类名称", required = true)
    private String categoryName;

    public ArticleCategoryPO toPO() {
        ArticleCategoryPO po = new ArticleCategoryPO();
        BeanUtils.copyProperties(this, po);
        return po;
    }

    public String getCategoryName() {
        return StringUtils.trim(categoryName);
    }
}
